<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php
	if (isset($title))
	{
		echo $title;
	}
?></title>
<meta name="Description" content="<?php
	if (isset($meta_description))
	{
		echo $meta_description;
	}
?>" />
<meta name="KeyWords" content="<?php
	if (isset($meta_keywords))
	{
		echo $meta_keywords;
	}
?>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="css/style.css" media="all" rel="stylesheet" type="text/css" />
<link href="css/magnific-popup.css" media="all" rel="stylesheet" type="text/css" />
<link href="css/datapicker.css" media="all" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="images/favicon.png" type="image/vnd.microsoft.icon" />

<script src="js/jquery-1.7.2.min.js" type="text/javascript" language="javascript"></script>
<script src="js/jquery-ui.js" type="text/javascript" language="javascript"></script>
<script src="js/jquery.colorbox-min.js" type="text/javascript" language="javascript"></script>
<script src="js/jquery.bootpag.min.js" type="text/javascript" language="javascript"></script>
<script src="js/jquery.jeditable.mini.js" type="text/javascript" language="javascript"></script>

<script src="js/jquery.validate.min.js" type="text/javascript" language="javascript"></script>
<script src="js/jquery.magnific-popup.min.js" type="text/javascript" language="javascript"></script>

<!--Hijri Date-->
<script src="js/jquery.calendars.min.js"></script>
<script src="js/jquery.calendars.ummalqura.min.js"></script>
<script src="js/jquery.calendars.ummalqura-ar.js"></script>
<script src="js/convertHijri.js" type="text/javascript" ></script>
<!--Hijri Date-->

<?php
	if (isset($additonalLink))
	{
		foreach ($additonalLink as $link)
			echo $link;
	}
?>

<script src="js/main.js" type="text/javascript" ></script>

</head>

<body class="<?php
	if (isset($body_class))
	{
		echo $body_class;
	}
?>">
<div id="wrap">

<div id="header">
<div id="header-wrap" class="relative">
<div class="right">
<a href="./<?php
	if (isset($_SESSION['r']) && $_SESSION['r'] == 3)
	{
		echo "reports.php";
	}
 ?>"> <img src="images/logo.png" class="right" title="Nazeel" Alt="logo" /></a>
<?php if (isset($_SESSION["logo"])){ ?><a href="./<?php
	if (isset($_SESSION['r']) && $_SESSION['r'] == 3)
	{
		echo "reports.php";
	}
 ?>"> <img src="<?php echo $_SESSION["logo"]; ?>" class="right" title="Nazeel" Alt="logo" /></a><?php } ?>
</div>
<div class="registerd-details">
<?php if(!isset($_SESSION['user_id'])){ ?>
<span class="left small black">أهلاً بـــ الزائر, الرجاء تسجيل الدخول</span>
<?php }else{ ?>
<span class=" hsmall blck">أهلا بك <?php echo $_SESSION['login_user']; ?></span>
<?php
if ($_SESSION['r']<=1)
{
?>
<a href="settings.php" class="blue">الاعدادات <span class="black">|</span></a>
<?php
	}
?>
<a href="view_profile.php" class="blue">ملفى الشخصى <span class="black">|</span></</a>
<?php
if(isset($_SESSION['admin_id']))
{
?>
<a href="loginas.php?id=<?php echo $_SESSION['admin_id']; ?>" class="blue">تسجيل الخروج من المستخدم <span class="black">|</span></a>
<?php
	}
?>
<a href="logout.php" class="blue">تسجيل الخروج</a>
<?php } ?>
</div>
<div class="clear"></div>
</div>
</div>

<div id="main">
<script>
	$('#login-buttom').click(function() {
		$('#username-password-login').submit();
	}); 
</script>

<script type="text/javascript" language="javascript">
	function changeImage(img) {
		document.getElementById('bigImage').src = img;
	}
</script>
<?php if( isset($_SESSION["user_id"])) { ?>
<div id="nazeel-menu">
<ul>
<?php
if ($_SESSION['r']<=2)
{
?>
<li><a href="./">الرئيسية</a></li>
<li><a href="apartments.php">الوحدات</a></li>
<li><a href="furnitures.php">الأثاث</a></li>
<li><a href="bookings.php">التأجير و الحجوزات</a></li>
<li><a href="customers.php">العملاء</a></li>
<li><a href="addService.php">الخدمات </a></li>
<?php
	}
	if ($_SESSION['r']==4)
	{
?>
<li><a href="apartments.php">الوحدات</a></li>
<?php
	}
	if ($_SESSION['r']<=2)
	{
?>
<li><a href="vouchers.php">السندات</a></li>
<li><a href="sms.php">الرسائل</a></li>
<?php
	}
?>
<?php
if ($_SESSION['r']<=4)
{
?>
<li><a href="reports.php">التقارير</a></li>
<?php
	}
?>
</ul>

</div>
<?php } ?>
<?php if(isset($_SESSION["error_message"])) { ?>
<div class="error-message">
<p><?php echo $_SESSION["error_message"];
	unset($_SESSION["error_message"]);
?>
</p>
</div>
<?php } ?>

<?php
	if (isset($_SESSION["success_message"]))
	{
		$hidden = "";
		$message = $_SESSION["success_message"];
		unset($_SESSION["success_message"]);
	}
	else
	{
		$hidden = "light-hidden";
		$message = "";
	}
?>
<div class="success-message-edit <?php echo $hidden; ?>">
<p><?php echo $message; ?>
</p>
</div>
<br />
